package com.example.activity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.provider.MediaStore.Video;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Iterator;
import com.example.smart_home.R;
import com.example.util.Constants;
import com.example.util.ShowHandle;

@SuppressLint({ "HandlerLeak" })
public class CurtainActivity extends Activity implements View.OnTouchListener {
	ImageButton btnClose;
	ImageButton btnOpen;
	ImageView video_iv;
	CurtainActivity context;
	ArrayList<String[]> data;
	String deviceId;
	ShowHandle showHandle;
	/*public void StopCarma()
	  {
	    this.isInitFinish = false;
	    this.isOnVideo = false;
	    Iterator localIterator = this.onlinelist.iterator();
	    while (localIterator.hasNext())
	    {
	      Video localVideo = (Video)localIterator.next();
	      if (6 < 0)
	        NativeCaller.StopPPPPLivestream(localVideo.getUid());
	      (0 + 1);
	    }
	  }*/

	public void onCreate(Bundle paramBundle) {
		super.onCreate(paramBundle);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.curtain);
		this.context = this;
	    this.showHandle = new ShowHandle(this, Constants.DB_NAME);
	    this.deviceId = getIntent().getStringExtra("deviceId");
	    this.showHandle.OpenDb();
	    this.data = this.showHandle.getDeviceKey(this.deviceId);
	    this.showHandle.CloseDb();
	    ((TextView)findViewById(R.id.title)).setText(getResources().getString(R.string.curtain));
	    ((TextView)findViewById(R.id.tvHomeName)).setText(getIntent().getStringExtra("roomName"));
	    
	    findViewById(R.id.btnBack).setOnClickListener(new View.OnClickListener()
	    {
	      public void onClick(View paramAnonymousView)
	      {
	       // MyAudioManager.spPlaySound(0, false);
	       // CurtainActivity.this.StopCarma();
	        CurtainActivity.this.finish();
	      }
	    });
	    ListView localListView = (ListView)findViewById(R.id.list_view);
	    localListView.setDividerHeight(0);
	    localListView.setAdapter(new CurtainAdapter(this));
	    this.video_iv = ((ImageView)findViewById(R.id.header_iv));
	  //  if ((this.isHaveCamra) && (InfoActivity.isRunVideo))
	    //  this.video_iv.setVisibility(0);
	    while (true)
	    {
	     // this.isInitFinish = true;
	      return;
	     // this.video_iv.setVisibility(8);
	    }
	}
	protected void onDestroy() {
		super.onDestroy();
	}

	protected void onResume() {
		super.onResume();
	}

	protected void onStop() {
		super.onStop();
	}

	public boolean onTouch(View paramView, MotionEvent paramMotionEvent) {
		return false;
	}
}
